<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Thymeleaf模板引擎</title>
</head>
<body>
msg内容：<span th:text="${msg}"></span><br/>
msg是否为空：<span th:text="${#strings.isEmpty(msg)}"></span><br/>
msg是否包含h：<span th:text="${#strings.contains(msg,'h')}"></span><br/>
msg转换为大写：<span th:text="${#strings.toUpperCase(msg)}"></span><br/>
<label>
    <input type="text" th:value="${msg}">
</label>
<hr>
时间格式化：<span th:text="${#dates.format(time,'yyyy-MM-dd')}"></span><br/>
年：<span th:text="${#dates.year(time)}"></span><br/>
月：<span th:text="${#dates.month(time)}"></span><br/>
日：<span th:text="${#dates.day(time)}"></span><br/>
<hr>
<p th:if="${sex}=='男'">不是女</p><br>
<div th:switch="${age}">
    <p th:case="10">小孩</p>
    <p th:case="20">中孩</p>
    <p th:case="30">大孩</p>
</div>

<p>抽取公共页面</p>

<!--insert:可以省略~{},将公共内容引入div标签中-->
<div th:insert="~{footer::common_footer}"></div>
<!--replace：内容直接替换div-->
<div th:replace="footer::common_footer"></div>
<!--include：公共页面标签里的内容复制到div中-->
<div th:include="footer::common_footer"></div>
</body>
</html>